﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Sol_NetCoreDemo.Controllers.DI
{
    [Route("api/[controller]")]
    [ApiController]
    public class DIController : ControllerBase
    {
        public IWork work;
        public Work2 work2;
        public DIController(IWork _work, Work2 _work2)
        {
            work = _work;
            work2 = _work2;
        }

        [HttpGet("World")]
        public async Task<IActionResult> World()
        {
            var dic = await Task.FromResult(work.World());
            return Ok(dic);
        }

        [HttpGet("World2")]
        public async Task<IActionResult> World2()
        {
            var dic = await Task.FromResult(work2.World());
            return Ok(dic);
        }

    }
}